<?php
/**
 * Controller of all actions related to print tasks of Emergency department

 * @package modules.dept_emer.controllers
 * @author ppdong
 * @version $Id$
 * @copyright 2009 LHV Company
 *
 */
class C_EmerPrint extends Controller {
    function C_EmerPrint($template_mod = "general") {
        parent::Controller();
        if (Celini::getCurrentController() == 'EmerPrint') {
            $menu =& Menu::getInstance();
            $menu->currentSection = 'patient';
        }
        $this->_db = $GLOBALS['frame']['adodb']['db'];
        $this->template_mod = $template_mod;
        $this->view->path = 'emer_print';
        
        $hospitalInfo = Celini::configInstance()->get('hospital_info');
       	$this->hospitalInfo	=	$hospitalInfo[L10nHelper::getLocale()];
    }

    public function actionPrintReportDeadOutside($deathInfoId = 0){
    	if(isset($_GET['deathInfoId'])){
    		$deathInfoId  =   $_GET['deathInfoId'];
    	}
        $objDeathInfo   =   Celini::newORDO('DeathOutsideInfo', $deathInfoId);
        $patientId      =   $objDeathInfo->get('patient_id');
        $objPatient     =   Celini::newORDO('Person',$patientId);
        $doctorName     =   Celini::newORDO('Person', $objDeathInfo->get('doctor_id'))->getName();
        $this->assign_by_ref('patient', $objPatient);
        $this->assign_by_ref('deathInfo', $objDeathInfo);
        $this->assign_by_ref('hospitalInfo', $this->hospitalInfo);
        $this->assign('doctorName', $doctorName);

    	return $this->view->render('print_report_dead_outside.html');
    }
}
?>